<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class TestController extends Controller {

    /**
     * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
     * using two-column layout. See 'protected/views/layouts/column2.php'.
     */
    public $layout = '//layouts/column2';

    /**
     * Displays a particular model.
     * @param integer $id the ID of the model to be displayed
     */
    public function actionView($id) {
        $this->render('view', array(
            'model' => $this->loadModel($id),
        ));
    }

    /**
     * Lists all models.
     */
    public function actionIndex() {
        $model=new TestModel;
	$this->render('index', array('model'=>$model, 'Test'=>'5555'));
        
        //$this->render('index', array('Test'=>'5555'));
    }

    /**
     * Limit - Named Scope
     *
     * @param int $limit
     * @param int $offset
     * @return Product
     */
    public function scopeLimit($limit = 30, $offset = 0) {
        $Criteria = new CDbCriteria();
        $Criteria->limit = $limit;
        $Criteria->offset = $offset;
        $this->getDbCriteria()->mergeWith($Criteria);
        return $this;
    }

}

?>
